In Spread.Services, you can use the properties of the IPlotArea Interface to set up the plot area in a chart as per your preferences.
You can configure the plot area format by changing its fill color, line color and other attributes using the Format property of the IPlotArea interface.
Refer to the following example code to configure plot area format for a chart inserted in your worksheet.
C# |
Copy Code |
---|---|
IShape shape = worksheet.Shapes.AddChart(ChartType.Column3D, 200, 100, 300, 300); worksheet.Range["A1:D6"].Value = new object[,] { {null, "S1", "S2", "S3"}, {"Item1", 10, 25, 25}, {"Item2", -51, -36, 27}, {"Item3", 52, -85, -30}, {"Item4", 22, 65, 65}, {"Item5", 23, 69, 69} }; shape.Chart.SeriesCollection.Add(worksheet.Range["A1:D6"], RowCol.Columns, true, true); IPlotArea plotarea = shape.Chart.PlotArea; //Format. plotarea.Format.Fill.Color.RGB = Color.Pink; plotarea.Format.Line.Color.RGB = Color.Green; |